{% extends "skeleton.html" %}
{% import "doc/macros.html" as m %}

{% block header %}
  {{m.html_header(resource_version)}}
{% endblock %}
{% block pagetitle %}{{page.title}}{% endblock %}
{% block title %}{{page.title}}{% endblock %}

{% block maincontent %}
  <section class="content view-content">
    <nav class="breadcrumbs">
      <ul>
        <li><a href="/">War Worlds</a>
        {% if page.slug == "/" -%}
          <li><span>Docs</span>
        {%- else -%}
          <li><a href="/doc">Docs</a>
          <li><span>{{page.title}}</span>
        {%- endif %}
      </ul>
    </nav>

    <nav class="page-controls">
      <h2>Revisions</h2>
    {% for revision in page.revisions %}
      {% if loop.index > 3 %}
        <div> . . . </div>
      {% else %}
        <div>
          {{m.profile_link(profiles[revision.user.user_id()])}}
          <time datetime="{{revision.date|date_std}}">{{revision.date|date_std}}</time>
        </div>
      {% endif %}
    {% endfor %}
    {% if is_logged_in %}
      <div><a href="/doc/_/revisions?slug={{page.slug}}">Revision history</a></div>
      <div><a href="/doc/_/edit?slug={{page.slug}}">Edit this page</a></div>
      {% if page.slug == '/' %}
      <hr>
      <div><a href="/doc/_/recent-changes">Recent changes</a></div>
      {% endif %}
    {% endif %}
    </nav>

    {{page.content}}
  </section>
{% endblock %}

